package net.gzw1993.runmate.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.lidroid.xutils.BitmapUtils;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;

import net.gzw1993.runmate.R;
import net.gzw1993.runmate.utils.MyBitmapUtilsHelper;

/**
 * Created by Administrator on 15-8-18.
 */
public class RunGroupGridAdapter extends SimpleBaseAdapter<String>{

    private BitmapUtils bitmapUtils;

    public RunGroupGridAdapter(Context context) {
        super(context);
        bitmapUtils = MyBitmapUtilsHelper.getInstance().getBitmapUtils();
    }

    @Override
    public View getItemView(int position, View convertView, ViewGroup parent) {
        if(convertView == null){
            convertView = inflater.inflate(R.layout.item_rungroup_greadview,parent,false);
            ViewHolder holder = new ViewHolder(convertView);
            convertView.setTag(holder);
        }
        ViewHolder holder = (ViewHolder) convertView.getTag();
        
        return convertView;
    }

    private static class ViewHolder{
        @ViewInject(R.id.item_gv_image)
        private ImageView image;
        @ViewInject(R.id.item_gv_name)
        private TextView name;

        public ViewHolder(View convertView){
            ViewUtils.inject(this,convertView);
        }
    }
}
